import { defineStore } from 'pinia'
interface stateInterface {
    userInfo: {
        nickName: string,
        [key: string]: string
    }
}

const jsonUserInfo = sessionStorage.getItem('userInfo');
const userInfo = jsonUserInfo ? JSON.parse(jsonUserInfo) : {};

export default defineStore({
    id: 'baseInfo',
    state: (): stateInterface => {
        return {
            userInfo
        }
    }
})